namespace Zaggit.Core
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using Zaggit.DomainObjects;

    /// <summary>
    /// Defines a sender and receiver of instant messages.
    /// </summary>
    public interface IMessager
    {
        /// <summary>
        /// Occurs when [message recieved].
        /// </summary>
        event Action<UserMessage> MessageRecieved;

        /// <summary>
        /// Gets the port which the messager listens on.
        /// </summary>
        /// <value>
        /// The port.
        /// </value>
        int Port { get; }

        /// <summary>
        /// Sends the specified message.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <returns>The number of bytes transmitted.</returns>
        int Send(UserMessage message);
    }
}
